home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / utils / tiny_firewall / tpf5.exe / Tiny Personal Firewall 5.0.msi / tableview.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-05-28  |  4.5 KB  |  126 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
  3.    <xsl:output method="html" indent="yes" />
  4.    <xsl:key name="keyExe" match="Event [App and Action]" use="App" />
  5.    <xsl:key name="keyAction" match="Event [App and Action]" use="Action/@fnc" />
  6.    <xsl:key name="keyExeAction" match="Event [App and Action]" use="concat (App, ' ', Action/@fnc)" />
  7.    
  8. <xsl:variable name="Def" select="document('FncIds.xml ')"/>
  9.    
  10.    <xsl:template match="/">
  11.       <html>
  12.          <head>
  13.             <title>Events by EXE</title>
  14.             <style type="text/css"> 
  15.    table
  16. {  border-collapse: collapse;
  17.    width: 90%;
  18.    table-layout: fixed;
  19.    border-style: solid;
  20. }
  21. table, td
  22. {  border-width: 1px;
  23. }
  24. td
  25. {  color: black;
  26.    font-family: Arial;
  27.    font-size: x-small;
  28.    border-right-style: none;
  29.    border-left-style: none;
  30.    border-top-style: solid;
  31.    border-bottom-style: solid;
  32. }
  33. .DarkBack
  34. {  background-color: #0066FF;
  35.    background-color: blue;
  36.    
  37.    color: white;
  38.    font-weight: bold;
  39. }
  40. .LightBack
  41. {  background-color: #99CCFF;
  42.    color: black;
  43. }
  44. .RightJustified
  45. {  text-align: right;
  46. }
  47.  
  48.    </style>
  49.          </head>
  50.          <body>
  51.                 <h3>Events by EXE</h3>
  52. <!--                
  53.                 <xsl:for-each select="//Event[generate-id() = generate-id(key('keyExe', App)[1])]">
  54.                <xsl:value-of select="App" />
  55.                <br />
  56.             </xsl:for-each>
  57.             <br/>
  58.             <hr/>
  59.                 <br />
  60.                 <xsl:for-each select="//Event[generate-id() = generate-id(key('keyAction', Action/@fnc)[1])]">
  61.                <xsl:value-of select="Action/@fnc" />
  62.                <br />
  63.             </xsl:for-each>
  64.                 <hr />
  65. -->                
  66.                 <hr />
  67.                 <table>
  68.                <!-- Process each Exe -->
  69.                <xsl:for-each select="//Event[generate-id(.) = generate-id(key('keyExe', App)[1])]">
  70.                   <xsl:variable name="strAppID">
  71.                      <xsl:value-of select="App" />
  72.                   </xsl:variable>
  73.                   <!-- Select all the Employees belonging to the Team -->
  74.                   <xsl:variable name="lstEvent" select="//Event[App=$strAppID]" />
  75.                   <!-- Show details for Employees in Team -->
  76.                   <xsl:call-template name="ShowEmployeesInTeam">
  77.                      <xsl:with-param name="lstEvent" select="$lstEvent" />
  78.                   </xsl:call-template>
  79.                </xsl:for-each>
  80.                <tr>
  81.                   <td colspan="4" class="RightJustified DarkBack">Grand Total</td>
  82.                   <td colspan="1" class="RightJustified DarkBack">
  83.                      <!-- Show Grand Total of hours for all Employees -->
  84.                      <xsl:value-of select="count(//Event)" />
  85.                   </td>
  86.                </tr>
  87.             </table>
  88.             </body>
  89.       </html>
  90.    </xsl:template>
  91.    <xsl:template name="ShowEmployeesInTeam">
  92.       <xsl:param name="lstEvent" />
  93.       <!-- Show the name of the Team currently being processed -->
  94.       <tr>
  95.          <td colspan="4" class="DarkBack">EXE: <xsl:value-of select="$lstEvent[1]/App" />
  96.             </td>
  97.          <td colspan="1" class="DarkBack RightJustified">EVENTS</td>
  98.       </tr>
  99.       <!-- Show the total hours for each Employee in the Team -->
  100.       <xsl:for-each select="$lstEvent[generate-id() = generate-id(key('keyExeAction', concat (App, ' ', Action/@fnc))[1])]">
  101.          <xsl:variable name="lngActionFnc" select="Action/@fnc" />
  102.          <!-- Show details of each Employee -->
  103.          <tr>
  104.             <td colspan="4">
  105.                     <!--<xsl:value-of select="$lstEmployee[EmployeeID=$lngEmployeeID]/Name"/>
  106.                     <xsl:value-of select="$lstEmployee[EmployeeID=$lngEmployeeID]/Surname"/>
  107.                     -->
  108.                     Action: 
  109.                     <xsl:value-of select="$Def//Fnc[@id_dec=$lngActionFnc]" /> (<xsl:value-of select="$lngActionFnc" />)
  110.                 </td>
  111.             <td colspan="1" class="RightJustified">
  112.                <!-- Show the total hours for the current Employee -->
  113.                <xsl:value-of select="count($lstEvent[ Action/@fnc=$lngActionFnc])" />
  114.             </td>
  115.          </tr>
  116.       </xsl:for-each>
  117.       <tr>
  118.          <td colspan="4" class="LightBack RightJustified">Sub-Total</td>
  119.          <td colspan="1" class="LightBack RightJustified">
  120.             <!-- Show the total hours for all Employees in the Team -->
  121.             <xsl:value-of select="count($lstEvent)" />
  122.          </td>
  123.       </tr>
  124.    </xsl:template>
  125. </xsl:stylesheet>
  126.